/*
 * @Descripttion: 出手鸭小程序
 * @version:1.0.1 
 * @Author: HHL
 * @Date: 2022-11-15 11:20:10
 * @LastEditTime: 2022-11-15 14:16:37
 * @LastEditors:Hui
 */

module.exports = {
  transpileDependencies: ['@dcloudio/uni-ui'],
  devServer: {
    // 使用现代的配置解决 Host/Origin header 问题
    allowedHosts: 'all',
    // 设置客户端配置
    client: {
      webSocketURL: 'auto://0.0.0.0:0/ws'
    },
    // 如果仍有 WebSocket 连接问题，可以禁用 WebSocket
    webSocketServer: false
  },
  chainWebpack: config => {
    // 兼容 Node.js 21
    config.module
      .rule('node')
      .test(/\.node$/)
      .use('node-loader')
      .loader('node-loader')
      .end()
  },
  css: {
    loaderOptions: {
      sass: {
        sassOptions: {
          // 静默弃用警告
          quietDeps: true
        }
      },
      scss: {
        sassOptions: {
          quietDeps: true
        }
      }
    }
  }
}